home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 15 / CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso / CUCD / Graphics / Ghostscript / source / shcgen.h < prev    next >
Encoding:
Text File  |  1994-10-01  |  2.2 KB  |  51 lines

  1. /* Copyright (C) 1994 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* shcgen.h */
  20. /* Interface to shcgen.c */
  21. /* Requires shc.h */
  22.  
  23. /* Compute an optimal Huffman code from an input data set. */
  24. /* The client must have set all the elements of *def. */
  25. /* The definition is guaranteed to be well-behaved. */
  26. int hc_compute(P3(hc_definition *def, const long *freqs, gs_memory_t *mem));
  27.  
  28. /* Convert a definition to a byte string. */
  29. /* The caller must provide the byte string, of length def->num_values. */
  30. /* Assume (do not check) that the definition is well-behaved. */
  31. /* Return the actual length of the string. */
  32. int hc_bytes_from_definition(P2(byte *dbytes, const hc_definition *def));
  33.  
  34. /* Extract num_counts and num_values from a byte string. */
  35. void hc_sizes_from_bytes(P3(hc_definition *def, const byte *dbytes, int num_bytes));
  36.  
  37. /* Convert a byte string back to a definition. */
  38. /* The caller must initialize *def, including allocating counts and values. */
  39. void hc_definition_from_bytes(P2(hc_definition *def, const byte *dbytes));
  40.  
  41. /* Generate the encoding table from the definition. */
  42. /* The size of the encode array is def->num_values. */
  43. void hc_make_encoding(P2(hce_code *encode, const hc_definition *def));
  44.  
  45. /* Calculate the size of the decoding table. */
  46. uint hc_sizeof_decoding(P2(const hc_definition *def, int initial_bits));
  47.  
  48. /* Generate the decoding tables. */
  49. void hc_make_decoding(P3(hcd_code *decode, const hc_definition *def,
  50.   int initial_bits));
  51.